<style>
.item-btn{text-align:center;padding-bottom:15px;}
.item-sbtn{padding:15px 35px 30px 35px;}
.item-sbtn .layui-btn{float: right;}
.item-sbtn .layui-form-label{width:auto;padding-left:0;}
.oshare_info{border: 3px dashed #E6E6E6;display:block;padding:20px 0;text-align:center;font-size:12px;color:#666}
.oshare_info a{color:#1284f6;text-decoration:underline;padding-right:10px}
.upbm_not .upbm_label{color:#999}
.upbm_not .layui-input-block{display:none;}
</style>
<form class="layui-form layui-font14" name="order" action>
<div class='notes'  style='margin-bottom:10px;'>
<li><h3>小提示：</h3></li>
<li><b>1.</b>操作后，若退款成功，卖家将仍需向您支付消保赔付金；</li>
<li><b>2.</b>操作后，您将无法再次操作消保免赔。</li>
</div>
{if sj()<$endTime}<div class="layui-form-item item-btn">
<font color="blue">当前交易还在消保免赔时间内！请等待【<span class='ttime green' endTime="{$endTime}"></span>】后再试！</font>
</div>
{else}
<div class="layui-form-item item-btn">
<div class="layui-form-item item-sbtn"><label class="layui-form-label">安全码</label>
<div class="layui-input-inline">
<input name="safe" class="layui-input" value="" lay-verify="safe" type="password" placeholder="请输入安全码" style="border:#56aa16 solid 1px;"></div><div class="layui-form-mid layui-word-aux" >
&nbsp;<a href="/fetch/safe" target="_blank">忘记安全码？</a></div>  <input type="button" class="layui-btn layui-btn-danger"  lay-submit="" lay-filter="main" value="恢复消保赔付" />
</div>
</div>{/if}
<input type="hidden" name="layer" value="1">
<input type="hidden" name="role" value="buy">
<input type="hidden" name="utime" value="">
<input type="hidden" name="action" value="cancel_waiver">
<input type="hidden" name="number" value="{:input('number')}">
<input type="hidden" name="passkey" value="{:passkey()}">
</form>

<script type="text/javascript">
var zindex=parent.layer.zIndex;//当前层INDEX
layer.title('<font color=red style="font-weight:700;font-size:14px;">恢复消保赔付</font>');
 layui.use('form', function(){
 var form = layui.form();
 form.verify({
	 	reason_txt: function(value) {
			if($.trim(value).length<10)  return '原因不能少于10个字！';
		}
});
form.on('submit(main)', function(data) {
	layer.load();
	dform(data.field,'order');
return false;
});

form.on('checkbox(upbm)',function(data){
		var $div=$(data.elem).closest(".layui-form-item");
		if(data.elem.checked){
			$div.removeClass("upbm_not");
			$('.layui-textarea').attr('placeholder','请说明修改退款金额原因，不能少于10个字！');
			$('.lay-submit').val('确认修改');
		}else{
			$div.addClass("upbm_not");
			$('.layui-textarea').attr('placeholder','请说明恢复消保赔付原因，不能少于10个字！');
			$('.lay-submit').val('确认补充');
		}
});

form.on('radio(backtype)',function(data){
		var $div=$(data.elem).closest(".layui-form-item").find('.backmoney_box');
		if(data.elem.value=='part'){
			$div.show();
		}else{
			$div.hide();
		}
});
form.on('radio(cashed_type)',function(data){
	    $('.layui-btn-cashed').val($(data.elem).data('title'));
	    $('.cashed_box').hide();
		$('.cashed_box_'+data.value).show();
});

form.on('select(main_reason)',function(data){
		$(data.elem).closest(".layui-form-item").find('.layui-form-mid').html(data.elem.value=='网盘失效'?'注：如果您不需要了，请在下方明确告知卖家不要再发货！':'');
});

	form.render(); //更新全部
$('.upbm_label').click(function(){$(this).prev().click();form.render('checkbox')});
});
 document.onkeydown = function(event) {
        var target, code, tag;
        if (!event) {
            event = window.event; //针对ie浏览器
            target = event.srcElement;
            code = event.keyCode;
            if (code == 13) {
                tag = target.tagName;
                if (tag == "TEXTAREA") { return true; }
                else { return false; }
            }
        }
        else {
            target = event.target; //针对遵循w3c标准的浏览器，如Firefox
            code = event.keyCode;
            if (code == 13) {
                tag = target.tagName;
                if (tag == "INPUT") { return false; }
                else { return true; }
            }
        }
    };
if(typeof revise_money == 'function') revise_money();

</script>
